﻿namespace TomatoBreak.Infrastructure
{
    using System;
    using System.Web.Mvc;

    public class GlobalFilterRegistrar : IRegistrar
    {
        private readonly GlobalFilterCollection filters;

        public GlobalFilterRegistrar(GlobalFilterCollection filters)
        {
            if (filters == null)
            {
                throw new ArgumentNullException("filters");
            }

            this.filters = filters;
        }

        public virtual void Register()
        {
            filters.Add(new HandleErrorAttribute());
        }
    }
}